<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
   <script>
     let num = [15, 35, 23, 83, 12, 43, 42, 55, 1]
        function  bubbleSort (num)
        {
            let len=num.length
            for (let i=0;i<len;i++){
              for (let j=0;j<len-i-1;j++)
              {
                  if (num[j] > num[j + 1]) {
                    let b=num[j]
                    num[j]=num[j+1]
                    num[j+1]=b
                  }
              }
            }
            return num
        }
        let user=bubbleSort(num)
        document.write(user)
   </script>
</body>
</html>